package com.aaa.marketresearch.android.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

/**
 * @author Nail
 */
public class EasyDateFormat {

    private static final String DATE_FORMAT = "dd-MM-yyyy";
    private static final DateFormat dateFormat = new java.text.SimpleDateFormat(DATE_FORMAT);

    public static String format(Date date) {
        String format = dateFormat.format(date);
        return format;
    }

    public static Date parse(String text) {
        Date date = null;
        try {
            date = dateFormat.parse(text);
        } catch (ParseException e) {
            SimpleLog.error(e.toString());
        }
        return date;
    }

}
